<?php
/***********************************************
	This class would filter & select only the
	relevant keywords in the article.
************************************************/
class KeywordsFilter {
	private $relevantKeywords = NULL;
	private $firstValue = NULL;
	private $firstInt = NULL;
	
	/************************************************************/
	
	function filterKeywords($keywords) {
		$this->relevantKeywords = explode(" ", $keywords, 2);
		$this->firstValue = $this->relevantKeywords[0];
		
		if (strpos($this->firstValue, ".") != FALSE) {
			$this->firstInt = intval(rtrim($this->firstValue, "."));
			
			if ($this->firstInt > 0 && $this->firstInt < 21) {
				return str_replace(",", "", ucwords(rtrim($this->relevantKeywords[1], ".")));
			} else {
				return FALSE;
			}
		} elseif ($this->firstValue > 0 && $this->firstValue < 21) {
			return str_replace(",", "", ucwords(rtrim($this->relevantKeywords[1], ".")));
		} else {
			return FALSE;
		}
	}
}
?>